package com.gdrcu.efp.cus.common;

/**
 * 将证件类型转换为第三方数据平台的证件类型
 * @author zmr
 * 2018-06-20
 */
public enum ChangeCertTypeToODS {

	CODE_10100("10100","201"),//居民身份证
	CODE_10400("10400","227"),//护照
	CODE_10501("10501","204"),//士兵证
	CODE_10900("10900","215"),//外国人居留证
	CODE_10602("10600","203"),//武警身份证
	CODE_10701("10701","210"),//港澳居民来往内地通行证
	CODE_10702("10702","213"),//台湾居民来往大陆通行证
	CODE_10703("10901","233"),//外国人永久居留证
	CODE_19999("19999","299"),//个人其它证件
	;
	private String key;
	private String value;
	public String getKey() {
		return key;
	}
	public String getValue() {
		return value;
	}
	private ChangeCertTypeToODS(String key, String value) {
		this.key = key;
		this.value = value;
	}
	 public static String parse(String key) {
	        for(ChangeCertTypeToODS certType : ChangeCertTypeToODS.values()) {
	            if(certType.value.equals(key)) {
	                return certType.getKey();
	            }
	        }
	        return "19999";
	 }
	 public static String parseKey(String key) {
	        for(ChangeCertTypeToODS certType : ChangeCertTypeToODS.values()) {
	            if(certType.key.equals(key)) {
	                return certType.getValue();
	            }
	        }
	        return "299";
	 }
}
